﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x02000426 RID: 1062
	[DisallowMultipleComponent]
	public class ObservableAnimatorTrigger : ObservableTriggerBase
	{
		// Token: 0x0600162A RID: 5674 RVA: 0x00061129 File Offset: 0x0005F529
		private void OnAnimatorIK(int layerIndex)
		{
			if (this.onAnimatorIK != null)
			{
				this.onAnimatorIK.OnNext(layerIndex);
			}
		}

		// Token: 0x0600162B RID: 5675 RVA: 0x00061144 File Offset: 0x0005F544
		public IObservable<int> OnAnimatorIKAsObservable()
		{
			Subject<int> result;
			if ((result = this.onAnimatorIK) == null)
			{
				result = (this.onAnimatorIK = new Subject<int>());
			}
			return result;
		}

		// Token: 0x0600162C RID: 5676 RVA: 0x0006116C File Offset: 0x0005F56C
		private void OnAnimatorMove()
		{
			if (this.onAnimatorMove != null)
			{
				this.onAnimatorMove.OnNext(Unit.Default);
			}
		}

		// Token: 0x0600162D RID: 5677 RVA: 0x0006118C File Offset: 0x0005F58C
		public IObservable<Unit> OnAnimatorMoveAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onAnimatorMove) == null)
			{
				result = (this.onAnimatorMove = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x0600162E RID: 5678 RVA: 0x000611B4 File Offset: 0x0005F5B4
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onAnimatorIK != null)
			{
				this.onAnimatorIK.OnCompleted();
			}
			if (this.onAnimatorMove != null)
			{
				this.onAnimatorMove.OnCompleted();
			}
		}

		// Token: 0x04000C86 RID: 3206
		private Subject<int> onAnimatorIK;

		// Token: 0x04000C87 RID: 3207
		private Subject<Unit> onAnimatorMove;
	}
}
